package com.example.score.mapper;

import com.example.score.entity.ExamBase;

import java.time.LocalDate;
import java.util.List;

import com.example.score.entity.input.SchoolBaseInput;
import com.example.score.entity.vo.ExamVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface ExamBaseMapper {
    int deleteByPrimaryKey(Long examId);

    int insert(ExamBase record);

    int insertSelective(ExamBase record);

    ExamBase selectByPrimaryKey(Long examId);

    int updateByPrimaryKeySelective(ExamBase record);

    int updateByPrimaryKey(ExamBase record);

    int updateBatch(@Param("list") List<ExamBase> list);

    int batchInsert(@Param("list") List<ExamBase> list);

    @Select("select * from t_exam_base where exam_id =#{examId} ")
    ExamBase selectByExamId(Long examId);

    List<ExamBase> selectByExamIds(@Param("examIds") List<Long> examIds);

    List<ExamBase> selectByExamIdsAndDate(@Param("examIds") List<Long> examIds, @Param("startTime") LocalDate startTime, @Param("endTime") LocalDate endTime);

    void deleteByExamId(Long examId);

    /**
     * 根据学校id查询
     * @param schoolId 学校id
     * @return 数据
     */
    List<ExamBase> selectBySchoolId(@Param("schoolId") Long schoolId);

    /**
     * 校本资源统计作业数量
     * @param schoolBaseInput 查询参数
     * @return 总数
     */
    int examCount(@Param("param") SchoolBaseInput schoolBaseInput);

    /**
     * 作业列表
     * @param param 参数
     * @return 作业列表
     */
    List<ExamVo> examList(@Param("param") SchoolBaseInput param);


}